<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>

    var name='the window';
    var obj={
        name:'my object',
        getFun:function (){

            var that=this;
            return function (){

               return that.name
            }
        }

    }

    console.log( obj.getFun()() )  ;
</script>
</body>
</html>